package com.trust.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.trust.agri.util.BeanUtil;
import com.trust.entity.SystemAccountRole;
import com.trust.entity.VO.DictionaryVO;
import com.trust.mapper.SystemAccountRoleMapper;
import com.trust.service.SystemAccountRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class SystemAccountRoleServiceImpl extends ServiceImpl<SystemAccountRoleMapper, SystemAccountRole> implements SystemAccountRoleService {

    @Override
    public List<DictionaryVO> dropDownList() {
        LambdaQueryWrapper<SystemAccountRole> wrapper = new LambdaQueryWrapper<>();
        wrapper.orderByDesc(SystemAccountRole::getId);
        return BeanUtil.sourceList2targetList(this.list(wrapper), DictionaryVO.class);
    }
}
